Skip to content

AI junk#3692

Closed
elio-Wang wants to merge 1 commit into
pallets:mainfrom
elio-Wang:feature/screenshot-workflow
Closed

AI junk#3692
elio-Wang wants to merge 1 commit into
pallets:mainfrom
elio-Wang:feature/screenshot-workflow

Conversation

@elio-Wang

Copy link
Copy Markdown

Summary

Implements the screenshot workflow described in #3081.

Adds a docs/screenshots.py module that renders Click help output as
annotated terminal-style PNG images using Pillow. The renderer:

  • Runs locally (no external API calls)
  • Works in CI (all deps are pip-installable, no browser binary needed)
  • Produces crisp images at 2x scale for high-DPI displays
  • Draws colored annotation boxes with labels around CLI sections
  • Auto-detects system monospace fonts on Linux/macOS/Windows

Screenshot

Annotated Click help output

Changes

  • docs/screenshots.py — New screenshot generator module
  • pyproject.toml — Add pillow to docs dependency group
  • docs/_static/cli-help-annotated.png — Generated screenshot
  • docs/quickstart.md — Add "Understanding the Help Output" section

Design Decisions

  • Pillow over headless browser: lighter weight, no browser binary
    needed in CI, fully pip-installable.
  • Auto-detect system fonts: avoids bundling font files; falls back
    to Pillow's built-in font if none found.
  • Annotation by text matching: annotations use start_text prefix
    matching to find line ranges, making them robust to output changes.
  • Standalone script: can be run manually (python docs/screenshots.py)
    rather than integrated as a Sphinx extension, keeping the build simple.

Closes #3081.

Add a Pillow-based screenshot generator that renders Click help output
as annotated terminal-style PNG images for use in the documentation.
The renderer supports colored annotation boxes with labels that
highlight different sections of CLI output (Usage, Options, Commands,
etc.).

All dependencies are pip-installable. Images are rendered at 2x scale
for crisp display on high-DPI screens. A system monospace font is
auto-detected on Linux, macOS, and Windows.

Closes pallets#3081.
@davidism davidism closed this Jul 16, 2026
@davidism davidism changed the title Add terminal screenshot workflow for docs AI junk Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Screenshot workflow

2 participants